package pl.wr.physics.units.quantum.mass;

import pl.wr.math.number.Fraction;
import pl.wr.physics.units.AbstractUnit;
import pl.wr.physics.units.Constants;
import pl.wr.physics.units.SI.Prefix;
import pl.wr.physics.units.SI.base.kg;
import pl.wr.physics.units.quantum.QuantumUnit;

/**
 * The unified atomic mass unit
 * 
 * @version 1.0
 * @author wieslaw.rodak
 * 
 */
public final class amu extends AbstractUnit implements QuantumUnit {

	public static final String symbol = "u";

	/**
	 * atomic mass unit
	 * 
	 * @param value
	 *            in <code>int</code>
	 */
	public amu(int value) {
		this(Prefix.basic, value);
	}

	/**
	 * atomic mass unit
	 * 
	 * @param value
	 *            in <code>float</code>
	 */
	public amu(float value) {
		this(Prefix.basic, value);
	}

	/**
	 * atomic mass unit
	 * 
	 * @param value
	 *            in <code>Fraction</code>
	 */
	public amu(Fraction value) {
		this(Prefix.basic, value);
	}

	/**
	 * atomic mass unit
	 * 
	 * @param p
	 *            - prefix SI
	 * @param value
	 *            - value in <code>int</code>
	 */
	public amu(Prefix p, int value) {
		super(p, value, amu.class.getSimpleName());
	}

	/**
	 * atomic mass unit
	 * 
	 * @param p
	 *            - prefix SI
	 * @param value
	 *            - value in <code>float</code>
	 */
	public amu(Prefix p, float value) {
		super(p, value, amu.class.getSimpleName());
	}

	/**
	 * atomic mass unit
	 * 
	 * @param p
	 *            - prefix SI
	 * @param value
	 *            - value in <code>Fraction</code>
	 */
	public amu(Prefix p, Fraction value) {
		super(p, value, amu.class.getSimpleName());
	}

	@Override
	public kg getSIValue() {
		return new kg(Fraction.multiply(getValue(), Constants.u.getValue()));
	}
}
